package com.LostAndFound.service;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.LostAndFound.dao.FalseDao;

public class FalseService {
	
	FalseDao dao = new FalseDao();

	// 得到记录总数
	public int getTotalFalse(String cid) {
		int total = 0;
		try {
			total = dao.getTotalFalse(cid);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return total;
	}

	public List<Map<String, Object>> getFlaseRecordList(int pageNumber, int pageSize, String cid) {
		List<Map<String, Object>> mapList = null;
		int startIndex = (pageNumber-1)*pageSize;
		try {
			mapList = dao.getFlaseRecordList(startIndex,pageSize,cid);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return mapList;
	}

	public boolean handleDeleteFlaseRecord(String aid) {
		boolean success = false;
		try {
			dao.handleDeleteFlaseRecord(aid);
			success = true;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return success;
	}

}
